package spring_toby.vol1.ch1.c164.springbook.user.dao;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CountingDaoFactory
{
	@Bean
	public UserDao userDao()
	{
		return new UserDao(connectionMaker());
	}

	@Bean
	public ConnectionMaker connectionMaker()
	{
		return new CountingConnectionMaker(realConnectionMaker());
	}

	@Bean
	public ConnectionMaker realConnectionMaker()
	{
		return new DConnectionMaker();
	}
}
